//
//  BuyerOwnTableViewCell.m
//  XinKaiFa55like
//
//  Created by 55like on 2017/9/25.
//  Copyright © 2017年 55like lj. All rights reserved.
//

#import "BuyerOwnTableViewCell.h"
#import "YYModel.h"


@implementation BuyerOwnTableViewCell
//销售单页面
-(void)setData:(NSDictionary *)data{
    
    BuyerOwnListModel * model = [BuyerOwnListModel yy_modelWithDictionary:data];
    
    self.titleLab.text = [NSString stringWithFormat:@"%@",model.name];
    self.titleLab.frame = CGRectMake(20, 10, kScreenWidth - 20 - 10, [[NSString stringWithFormat:@"%@",model.name] HEIGHTwF:15 W:kScreenWidth - 20 - 10]);
    
    self.deslab.text = [NSString stringWithFormat:@"%@ | %@ | %@",model.mobile,model.wechat,[data valueForJSONStrKey:@"contract"]];
    self.deslab.frame = CGRectMake(20, YH(self.titleLab) + 10, self.titleLab.frameWidth, [[NSString stringWithFormat:@"%@ | %@ | %@",model.mobile,model.wechat,[data valueForJSONStrKey:@"contract"]] HEIGHTwF:13 W:kScreenWidth - 20 - 10]);
    
    self.icon.frame = CGRectMake(20, YH(self.deslab) + 10, 12, 12);
    self.icon.image = [UIImage imageNamed:@"xkf_timeicon"];
    
    self.timelab.frame = CGRectMake(XW(self.icon) + 10, Y(self.icon), kScreenWidth - XW(self.icon), self.icon.frameHeight);
    self.timelab.text = model.ctime;
    
    
    
}
//自有页面
-(void)setModel:(BuyerOwnListModel *)model{
    
    
    self.titleLab.text = [NSString stringWithFormat:@"%@(%@)",model.name,model.companyname];
    self.titleLab.frame = CGRectMake(20, 10, kScreenWidth - 20 - 10, [[NSString stringWithFormat:@"%@(%@)",model.name,model.companyname] HEIGHTwF:15 W:kScreenWidth - 20 - 10]);
    
    self.deslab.text = [NSString stringWithFormat:@"%@ | %@ | %@",model.mobile,model.wechat,model.email];
    self.deslab.frame = CGRectMake(20, YH(self.titleLab) + 10, self.titleLab.frameWidth, [[NSString stringWithFormat:@"%@ | %@ | %@",model.mobile,model.wechat,model.email] HEIGHTwF:13 W:kScreenWidth - 20 - 10]);
    
    self.icon.frame = CGRectMake(20, YH(self.deslab) + 10, 12, 12);
    self.icon.image = [UIImage imageNamed:@"xkf_timeicon"];
    
    self.timelab.frame = CGRectMake(XW(self.icon) + 10, Y(self.icon), kScreenWidth - XW(self.icon), self.icon.frameHeight);
    self.timelab.text = model.ctime;
    
    
}





-(UILabel *)titleLab{
    
    if (!_titleLab) {
        
        UILabel * lab = [[UILabel alloc]init];
        lab.textColor = rgbTitleDeepGray;
        lab.font = Font(15);
        lab.textAlignment = NSTextAlignmentLeft;
        lab.numberOfLines = 0;
        [self addSubview:lab];
        _titleLab = lab;
        
    }
    
    return _titleLab;
}
-(UILabel *)deslab{
    
    if (!_deslab) {
        UILabel * lab = [[UILabel alloc]init];
        lab.textColor = rgbTxtGray;
        lab.font = Font(13);
        lab.numberOfLines = 0;
        lab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:lab];
        _deslab = lab;
    }
    return _deslab;
}
-(UILabel *)timelab{
    
    if (!_timelab) {
        
        UILabel * lab = [[UILabel alloc]init];
        lab.textColor = rgbTxtGray;
        lab.font = Font(12);
        lab.textAlignment = NSTextAlignmentLeft;
        [self addSubview:lab];
        _timelab = lab;
    }
    
    return _timelab;
}
-(UIImageView *)icon{
    
    if (!_icon) {
        
        UIImageView * icon = [[UIImageView alloc]init];
        [self addSubview:icon];
        _icon = icon;
    }
    
    return _icon;
}
@end
